// pages/index/detail/detail.js
import { getRemindCardInformation } from '../../api/index'
Page({
  data:{
    remind:{ 
    drugDays: "4",
    drugDuring: "2",
    drugName: "阿司匹林",
    drugNumber: "2",
    drugSpace: "隔3天吃",
    note: "记得按时吃药"
  }
  },
  onLoad(options){
    this.setData({id:options.id})
    getRemindCardInformation({id:options.id})
      .then(res=> {
        let { remind } = res;
        let { drugSpace } = remind;
        drugSpace == '0' ? drugSpace = '每天' : `隔${drugSpace}天吃`
        remind.drugSpace = drugSpace
        this.setData({remind})
      })
  }
})